<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增学生信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-customer-edit">
        <input name="id" class="form-control" type="hidden" th:value="${customer.id}">
        <div class="form-group">
            <label class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-8">
                <input name="name" class="form-control" type="text" th:value="${customer.name}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <select name="sex" class="form-control m-b">
                    <option value="男" th:selected="${customer.sex eq '男' }">男</option>
                    <option value="女"  th:selected="${customer.sex eq '女' }">女</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属公司名称：</label>
            <div class="col-sm-8">
                <input name="company" class="form-control" type="text" th:value="${customer.company}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系方式：</label>
            <div class="col-sm-8">
                <input name="telephone" class="form-control" type="text" th:value="${customer.telephone}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系地址：</label>
            <div class="col-sm-8">
                <input name="address" class="form-control" type="text" th:value="${customer.address}">
            </div>
        </div>
        <div id="element1" class="row">
            <label class="col-sm-3 control-label">所属区域：</label>
<!--            <div class="col-sm-2">-->
<!--                <select class="province form-control m-b" data-first-title="选择省">-->
<!--                    <option value="">选择省</option>-->
<!--                    <option th:each=" p : ${provinceList}" th:value="${p.provId}" th:text="${p.provName}" th:selected="${provId} eq ${p.provId}"></option>-->
<!--                </select>-->
<!--            </div>-->
            <div class="col-sm-2">
                <select name="sysCityId" class="city form-control m-b" data-first-title="选择市">
                    <option value="">选择市</option>
                    <option th:each=" c : ${cityList}" th:value="${c.cityId}" th:text="${c.cityName}" th:selected="${customer.sysCityId} eq ${c.cityId}"></option>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">描述：</label>
            <div class="col-sm-8">
                <textarea id="mkDesc" name="mkDesc" class="form-control valid" required="" aria-invalid="false" th:text="${customer.mkDesc}"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b">
                    <option value="1" th:selected="${customer.status} == 1">可用</option>
                    <option value="0"  th:selected="${customer.status} == 0">不可用</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建人：</label>
            <div class="col-sm-8">
                <input name="sysCreateUserId" class="form-control" type="text" th:value="${customer.sysCreateUserId}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="createTime" class="form-control" placeholder="yyyy-MM-dd" type="text" th:value="${#dates.format(customer.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "market/customer"
    $("#form-customer-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-customer-edit').serialize());
        }
    }

    $("input[name='createTime']").datetimepicker({
        format: "yyyy-MM-dd HH:mm:ss",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>